home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / fixtx401.zip / FIXTEXT.DOC < prev    next >
Text File  |  1994-01-08  |  15KB  |  302 lines

  1. FIXTEXT.DOC
  2. 01/08/94
  3.  
  4. The FIXTEXT.EXE program applies a character translation template to any
  5. entire text file.  This allows you to change a whole bunch of characters
  6. at once.  Features:
  7.  
  8.   * Can process text files of any size.
  9.   * Can process DOS text files (lines ending with CR/LF), Mac text files
  10.     (lines ending with CR), Unix text files (lines ending with LF), and
  11.     fixed length files (lines of a fixed length without any CR or LF characters)
  12.   * Can convert any of the above four types of text files to any of the
  13.     other types of text files.
  14.   * Can load a user-defined character translation tables.
  15.   * Character translation tables can let you do things like:
  16.       - Convert all lowercase characters to uppercase characters
  17.       - Translate IBM graphics characters into standard ASCII text characters;
  18.         this is very useful if you want to print the document and are tired of
  19.         getting weird stuff printing out.
  20.   * Can translate tab characters into spaces.
  21.   * Can fix up underscores and other backspace characters.
  22.   * Can remove trailing spaces from lines.
  23.   * Can create a file showing all lines that were changed.
  24.   * Can translate single characters into multiple characters or remove them
  25.     entirely.
  26.  
  27.  
  28. The character-translation table:
  29.  
  30. FIXTEXT.EXE will process a character-translation table if one is available.  By
  31. default, it will look for a file called FIXTEXT.INI which it looks for in the
  32. following locations in the following order:
  33.  
  34.         C:\
  35.         your default subdirectory
  36.         the directory where FIXTEXT.EXE was found
  37.  
  38. A sample FIXTEXT.INI file is provided.  You can modify this file or create your
  39. own.
  40.  
  41. You can override the FIXTEXT.INI filename by providing a "/Ifilename" parameter.
  42. You can also specify that no character-translation table be provided by passing
  43. in the parameter "/-I" in which case a default translation table will be brought
  44. in.  This one is identical to the original FIXTEXT.INI file and has these
  45. characteristics:
  46.  
  47.   - All characters in the decimal 032 to 125 range are left unchanged
  48.   - Characters in decimal 24 to 27, and 176 to 223 are considered graphics
  49.     characters and are translated into regular text characters, typically
  50.     ".", "X", "x", "|", "-", and "+"
  51.   - Decimal characters 248 to 250 and 254 are changed into asterisks ("*")
  52.   - All other characters are translated into spaces
  53.  
  54.  
  55. As an example of the graphics character translation that's done, the following:
  56.  
  57.          ┌─┬─┐   ╔═╦═╗                      +-+-+   +-+-+
  58.          │ │ │   ║ ║ ║                      | | |   | | |
  59.          ├─┼─┤   ╠═╬═╣        becomes:      +-+-+   +-+-+
  60.          │ │ │   ║ ║ ║                      | | |   | | |
  61.          └─┴─┘   ╚═╩═╝                      +-+-+   +-+-+
  62.  
  63. It may not look as good but it certainly prints better on most printers.
  64.  
  65. The character translation file is an ASCII text file which consists of a series
  66. of lines in the following format:
  67.  
  68.         inchar = outstr
  69.  
  70. where "inchar" is the character to change from and "outstr" is what to change
  71. the character to.  Both portions can consist of regular ASCII text characters
  72. (like "A" or "z") as well as hexadecimal values (in the form &Hxx) or decimal
  73. values (in the form \nnn).  "outstr" can consist or 0 (the word "(NONE)"), 1, or
  74. 2 or more replacement characters while "inchar" can only represent a single
  75. character.  You cannot use a space or equal sign in either "inchar" or "outstr";
  76. use the hexadecimal or decimal representations instead.  The table does not have
  77. to be in any specified order.  Lines can end with "/*" followed by a comment if
  78. you want.  Examples:
  79.  
  80.         a    = A /* Translate lowercase "a" into capital "A"
  81.         \032 = _ /* Translate space (decimal 032, &H20 too) into underscore
  82.         &H0c = <PAGE>\013\010 /* Translate page eject character into chars
  83.                               /* "<PAGE>" followed by carriage return/line feed
  84.         \027 = \032    /* Translate escape character to a space
  85.         \027 = (NONE)  /* Remove excape characters entirely
  86.  
  87. Note that when characters are not translated into single characters, all of the
  88. single-character translations are performed first and then the remaining
  89. translations are performed in the order they were specified.  So something like
  90. the following would result in some lines being changed twice:
  91.  
  92.         A = CAPITAL_A
  93.         a = A
  94.  
  95. In this case, all lowercase "a" characters would first be translated into an
  96. uppercase "A", and then the same character would then be translated into the
  97. string "CAPITAL_A".
  98.  
  99. Blank lines or those beginning with the following are ignored as comments:
  100.  
  101.                         ;    (semi-colon)
  102.                         :    (colon)
  103.                         '    (quote)
  104.                         /*   (slash asterisk)
  105.  
  106. If you're sole purpose in using FIXTEXT is to expand tabs or change text formats
  107. (say, DOS text into Unix text) and you do not want *any* character translations
  108. done, you will have to set up a dummy character translation file and reference
  109. it using the "/Ifilename" parameter.  It can consist of just a comment line if
  110. you want.
  111.  
  112. Syntax:
  113.  
  114.     FIXTEXT infile { outfile [ /OVERWRITE | /-OVERWRITE | /OVERASK ] |
  115.       /REPLACE } [ /Ifilename | /-I ] [ /TEXT | /-TEXT ] [ /EJECT=str ]
  116.       [ /CRLF | /CR | /LF | /-LINE ] [ /TO CRLF | /TO CR | /TO LF | /TO -LINE ]
  117.       [ /WIDTH=n ] [ /Ffilename | /-F ] [ /Q ] [ /? | /?&H ]
  118.  
  119. "infile" is the name of the input file to check.  It can include a drive and
  120. path specification.
  121.  
  122. "outfile" is the name of the file to create.  It can include a drive and path
  123. specification.  You have to specify either an outfile or the /REPLACE option.
  124.  
  125. "/OVERWRITE" says to overwrite the output file if it exists already.
  126.  
  127. "/-OVERWRITE" says to abort if the output file exists already.
  128.  
  129. "/OVERASK" says to prompt if the output file exists already; this is the
  130. default.
  131.  
  132. "/REPLACE" says to write the results to a temporary file and, if the program
  133. finds characters to change and runs successfully, to replace the original file
  134. with the fixed temporary file.  The original file is renamed with a BAK
  135. extension if you use this option.  You have to specify *either* an output file
  136. name or the /REPLACE option.
  137.  
  138. "/Ifilename" says to read a character-translation table saved in "filename".
  139. This can include drive and path information if desired.  If neither "/Ifilename"
  140. nor "/-I" is specified, the program will look for a file called FIXTEXT.INI.
  141.  
  142. "/-I" says to skip reading the FIXTEXT.INI character-translation table even if
  143. it's present.  In that case, the default character-translation table is used.
  144. See the discussion about this in the "Character-translation table" section
  145. above.
  146.  
  147. "/TEXT" is used if you want the following three extra steps performed:
  148.   - All tabs are expanded into spaces based on the logical position of the
  149.     tab in the line
  150.   - All backspace characters are resolved
  151.   - All trailing spaces are removed from the line
  152. /TEXT mode is typically the default for this program but you can override this
  153. using the CONFIGWS.EXE program.
  154.  
  155. "/-TEXT" does not perform the extra three steps that /TEXT does.
  156.  
  157. "/EJECT=str" says to replace the page eject character (decimal 12) with another
  158. string.  This replacement can be 0 characters (if you say "/EJECT=(NONE)"), 1
  159. character, or 2 or more characters.  The string can include text, decimal, or
  160. hexadecimal characters.  Any /EJECT=str specification overrides any
  161. specification in the character-translation tables.
  162.  
  163.  
  164. "/CRLF" says the input file has text lines which end with a carriage return,
  165. line feed (decimal 13, followed by decimal 10).  This is standard for DOS text
  166. files.  This is also typically the default for FIXTEXT although you can override
  167. this using the CONFIGWS.EXE program.
  168.  
  169. "/CR" says the input file has text lines which end with just a carriage return.
  170. This is standard for Mac text files.
  171.  
  172. "/LF" says the input file has text lines which end with just a line feed.  This
  173. is standard for Unix text files.
  174.  
  175. "/-LINE" says the inpu